<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/vote',
    'namespace' => 'Frieza\\Modules\\Vote\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {

    // 投票列表
    $router->get('/index', 'VoteController@index');
    // 编辑
    $router->get('/index/{id}/edit', 'VoteController@edit');
    // 创建
    $router->get('/index/create', 'VoteController@edit');
    // 保存
    $router->post('/index/save', 'VoteController@saveSubmit');


    // 选项列表
    $router->get('/options/{id}', 'VoteController@optionList');
    // 排序
    $router->post('/options/sort', 'VoteController@sortOption');
    //保存
    $router->post('/options/{vote_id}', 'VoteController@optionSaveSubmit');
    $router->put('/options/{vote_id}/{option_id}', 'VoteController@optionSaveSubmit');
    //删除
    $router->delete('/options/{vote_id}/{option_id}', 'VoteController@delOption');





    // 操作上线
    $router->post('/online', 'VoteController@online');
    // 修复计数器
    $router->post('/repair', 'VoteController@repair');

});
